<?php
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/
  defined('_JEXEC') or die('Retricted Access');
  
  JHTML::_('behavior.tooltip');
?>

<form name="adminForm" action="index.php" method="post">
<table width="100%">
	<tr>
	
		<td width="80%" valign="top">    
	<div style="width:100%;">
		<table>
			<tr>
				<td align="left" width="100%">
					<?php echo JText::_( 'Filter' ); ?>:
					<input type="text" name="search" id="search" value="<?php echo $this->lists['search'];?>" class="text_area" onchange="document.adminForm.submit();" />
					<button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
					<button onclick="document.getElementById('search').value=''; document.getElementById('filter_table').value='ja_profiles'; this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
				</td>
				<td nowrap="nowrap">
				<?php
				echo JText::_( 'Table Filter' ).": &nbsp;";
				echo $this->lists['tables'];
				?>
			</td>

			</tr>
		</table>

		<table class="adminlist">
        	<thead>
				<tr>
					<th width="20">
						<?php echo JText::_( 'NUM' ); ?>
					</th>
					<th width="20">
						<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->items); ?>);" />
					</th>
					<th width="22%" nowrap="nowrap">
						<?php echo JHTML::_('grid.sort',  JText::_('Column Name'), 'ff.label', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
					</th>
					<th width="18%" nowrap="nowrap">
						<?php echo JHTML::_('grid.sort',   JText::_('Field name'), 'ff.field_name', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
					</th>
					<th width="15%" nowrap="nowrap">
						<?php echo JHTML::_('grid.sort',   JText::_('Field Ordering'), 'fl.ordering', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
						<?php echo JHTML::_('grid.order',  $this->items ); ?>  
					</th>					
					<th width="5%" class="title">
						<?php echo JHTML::_('grid.sort',   JText::_('Is required'), 'ff.is_required', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
					</th>
				</tr>
			</thead>
			<tbody>
        	<?php
        	$items = $this->items;
        	$k = 0;
        	$orderNo = 0;
        	$currentTable = '';
        	for($i = 0, $n = count($items); $i < $n; $i++, $orderNo++){
        		$item = $items[$i];
        		$checked 	= JHTML::_('grid.checkedout',   $item, $i );        		
				
        		?>
        		<tr class="row<?php echo $k; ?>">
            		<td align="center"><?php echo $this->pagination->getRowOffset($i); ?></td>
            		<td width="10" align="center"><?php echo $checked; ?></td>

            		<td width="35%">
            		<span class="editlinktip hasTip" title="<?php echo JText::_( 'Edit Field List' );?>::<?php echo $item->field_name; ?>">
					<a href="<?php echo JRoute::_( 'index.php?option='. $this->lists['option'] .'&view=jafieldlist&task=edit&cid[]='.$item->id ); ?>"><?php echo $item->label; ?></a></span>
            		</td>

            		<td width="30%"><?php echo $item->field_name; ?></td>

            		<td class="order" nowrap="nowrap">
						<span><?php echo $this->pagination->orderUpIcon( $i, true, 'orderup', 'Move Up', $this->ordering); ?></span>
						<span><?php echo $this->pagination->orderDownIcon( $i, $n, true, 'orderdown', 'Move Down', $this->ordering ); ?></span>
						<?php $disabled = $this->ordering ?  '' : 'disabled="disabled"'; ?>
						<input type="text" name="ordering[]" size="5" value="<?php echo $item->ordering; ?>" <?php echo $disabled ?> class="text_area" style="text-align: center" />
					</td>            		
            		<td align="center">
            			<?php 
						if( $item->is_required ){
							echo '<img src="images/tick.png" border="0" alt="required" />';
						}
						else{
							echo '-';
						}
						?>
						&nbsp;
            		</td>
            	</tr>
        	<?php
        		$k = 1 - $k;
			}
        	?>
        	<tbody>
        	<tfoot>
				<tr>
					<td colspan="9">
						<?php echo $this->pagination->getListFooter(); ?>
					</td>
				</tr>
			</tfoot>
		</table>
	</div>
	</td>
	</tr>
	</table>
	<input type="hidden" name="option" value="<?php echo $this->lists['option']; ?>" />
	<input type="hidden" name="view" value="jafieldlist" />
	<input type="hidden" name="task" value="view" />
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
	<?php echo JHTML::_( 'form.token' ); ?>	
 </form>
